<template>
  <div class="container">
    <div class="header">
      <h1>容猫医美，{{ plantform }}</h1>
    </div>
    <img src="../../assets/images/run.gif" alt="">
  </div>
</template>

<script>
import { mapGetters } from 'vuex'
import { getPlantformText } from '@/utils/config'

export default {
  data() {
    return {
      plantform: ''
    }
  },
  computed: {
    ...mapGetters([
      'sidebar'
    ]),
    routes() {
      return this.$router.options.routes
    }
  },
  mounted() {
    const userInfo = localStorage.getItem('userInfo')
    const token = localStorage.getItem('token')
    try {
      const pUser = JSON.parse(userInfo)
      if (pUser && pUser.account_type && token) {
        this.plantform = getPlantformText()
      } else {
        localStorage.removeItem('userInfo')
        localStorage.removeItem('token')
        window.location.href = '/#/login'
      }
    } catch (error) {
      localStorage.removeItem('userInfo')
      localStorage.removeItem('token')
      window.location.href = '/#/login'
    }
  }
}
</script>

<style scoped>
  .container{
    text-align: center;
    width: 100%;
    height: calc(100vh - 50px);
    background: rgb(227,227,227);
  }
  .container img{
    width: 800px;
  }
  .header{
    background: rgb(227,227,227);
    font-size: 30px;
    height: 200px;
    padding-top: 30px;
  }
</style>
